CC := g++

CFLAGS := -Wall -Werror

all: smallc

smallc: smallccompiler.cpp
	${CC} -c smallccompiler.cpp ${CFLAGS}
	${CC} -g smallc.cpp -o smallc smallccompiler.o ${CFLAGS}
	del *.o

clean:
	del *.o

# # hash动态链接库
# hash: hash.c list.c ${LOCK}.c
# 	${CC} -c -fpic hash.c ${CFLAGS}
# 	${CC} -c -fpic list.c ${CFLAGS}
# 	${CC} -c -fpic ${LOCK}.c ${CFLAGS}
# 	${CC} -shared -o libhash.so hash.o list.o ${LOCK}.o

# gettime: gettime.c
# 	${CC} -c -fpic gettime.c ${CFLAGS}
# 	${CC} -shared -o libgettime.so gettime.o

# # counter动态链接库
# counter: counter.c ${LOCK}.c
# 	${CC} -c -fpic counter.c ${CFLAGS}
# 	${CC} -c -fpic ${LOCK}.c ${CFLAGS}
# 	${CC} -shared -o libcounter.so counter.o ${LOCK}.o

# # 测试counter
# testcounter: testcounter.c
# 	${CC} -g testcounter.c -o testcounter -lcounter ${LIBFLAGS} -L. ${CFLAGS}

# # scalable_counter动态链接库
# scalable_counter: scalable_counter.c ${LOCK}.c
# 	${CC} -c -fpic scalable_counter.c ${CFLAGS}
# 	${CC} -c -fpic ${LOCK}.c ${CFLAGS}
# 	${CC} -shared -o libscalable_counter.so scalable_counter.o ${LOCK}.o

# # 测试scalable_counter
# testscalable_counter: testscalable_counter.c
# 	${CC} -g testscalable_counter.c -o testscalable_counter -lscalable_counter ${LIBFLAGS} -L. ${CFLAGS}

# # list动态链接库
# list: list.c ${LOCK}.c
# 	${CC} -c -fpic list.c ${CFLAGS}
# 	${CC} -c -fpic ${LOCK}.c ${CFLAGS}
# 	${CC} -shared -o liblist.so list.o ${LOCK}.o

# # 测试list
# testlist: testlist.c
# 	${CC} -g testlist.c -o testlist -llist ${LIBFLAGS} -L. ${CFLAGS}

# # hash动态链接库
# hash: hash.c list.c ${LOCK}.c
# 	${CC} -c -fpic hash.c ${CFLAGS}
# 	${CC} -c -fpic list.c ${CFLAGS}
# 	${CC} -c -fpic ${LOCK}.c ${CFLAGS}
# 	${CC} -shared -o libhash.so hash.o list.o ${LOCK}.o

# # 测试hash
# testhash: testhash.c
# 	${CC} -g testhash.c -o testhash -lhash ${LIBFLAGS} -L. ${CFLAGS}

